package cn.kgc.crowdfundingadminspringboot4.controller;

import cn.kgc.crowdfundingadminspringboot4.common.CrowdFundingUtils;
import cn.kgc.crowdfundingadminspringboot4.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpSession;

/**
 * @author 邓云辉
 * @create 2020-02-20 8:37
 */

















































@Controller
@RequestMapping("/admin")
public class loginController {

    //登录md5验证
    @RequestMapping("/do/login.html")
    public String doLogin(
            @RequestParam("loginAcct") String loginAcct,
            @RequestParam("userPswd") String userPswd){
        if (loginAcct.equals("admin")){
            String password= CrowdFundingUtils.md5("123456");
            String password2=CrowdFundingUtils.md5(userPswd);
            if(password.equals(password2)){
                return "index2";
            }
            return "";
        }
        return "";
    }
}
